#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <gmp.h>
#include <time.h>
#include <stdint.h>

#define SIZE_16 2
#define WORDS_16_BITS 16
#define NAILS 0
#define BASE 2
#define ORDER 1
#define ENDIAN 0
/* You are suppose to change the routine Product16 here to your own routine 
 * The mpz calls in the scaffolded Product16 below are the normal GMP function
 * calls and should be neglected. By casting the void pointers as normal unsigned
 * integers, you should be able to access the data values as normal 4 bytes words.
 */
extern Multiply16(unsigned short int *x, unsigned short int *y,
		unsigned short int *z, size_t sx, size_t sy, size_t *sz);

void Product16(uint16_t *a, uint16_t *b, uint16_t *c, size_t sa, size_t sb,
		size_t *sc) {

	//    mpz_t x,y,z;
	//    mpz_init(x);
	//    mpz_init(y);
	//    mpz_init(z); 

	/* Now sint_a can be view as an array of words of size 16 bits */
	/* Similarly for sint_b */
	//    printf("%u %u \n", sint_a[0], sint_a[*sa - 1]);
	//    printf("%u %u \n", sint_b[0], sint_b[*sb - 1]);
	//    printf("%d %d  %d \n",*sa, *sb, *sc);

	Multiply16(a, b, c, sa, sb, sc);
	//    printf("%u %u \n", sint_c[0], sint_c[*sc - 1]);

	//    mpz_import(x, *sa, ORDER, SIZE_16, ENDIAN, NAILS, a);
	//    mpz_import(y, *sb, ORDER, SIZE_16, ENDIAN, NAILS, b);
	//    mpz_mul(z,x,y);
	//    
	//    c = mpz_export(c, sc, ORDER, SIZE_16, ENDIAN, NAILS, z);
}

